﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MaterialsGrid.ascx.cs"
    Inherits="Workflow.Alerts.Sublayouts.MaterialsGrid" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:UpdateProgress ID="UpdateProgress2" runat="server" DisplayAfter="3">
    <ProgressTemplate><div class="progress">Updating&hellip;</div></ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel runat="server" ID="updMaterials" UpdateMode="Conditional">
    <ContentTemplate>
        <div id="DivMaterialsList" runat="server" class="materialsList">
            <asp:Repeater ID="rptMaterialList" runat="server" OnItemCommand="rptMaterialList_ItemCommand"
                OnItemDataBound="rptMaterialList_ItemDataBound">
                <HeaderTemplate>
                    <table>
                        <tr>
                            <th>
                                Materiaal
                            </th>
                            <th>
                                Aantal
                            </th>
                            <th>
                                Eenheid
                            </th>
                            <th>
                                Uitvoerder
                            </th>
                            <th>
                                Uitstel
                            </th>
                            <th>
                            </th>
                            <th>
                            </th>
                            <th>
                            </th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <%# Eval("materialname") %>
                        </td>
                        <td>
                            <%# Eval("quantity") %>
                        </td>
                        <td>
                            <%# Eval("unit") %>
                        </td>
                        <td>
                            <asp:Image ID="imgUitvoerder" runat="server" />
                        </td>
                        <td>
                            <asp:Image ID="imgUitstel" runat="server" />
                        </td>
                        <td>
                            &euro; <%# Eval("price", "{0:0.00}")%>
                        </td>
                        <td class="btn">
                            <asp:Button ID="btnEdit" runat="server" class="edit" CommandName="Edit" Text="" />
                        </td>
                        <td class="btn">
                            <asp:Button ID="btnDelete" runat="server" class="delete" CommandName="Delete" Text="" />
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table></FooterTemplate>
            </asp:Repeater>
            <asp:Literal ID="ltMaterialsValidation" runat="server"
                    visible="false" Text="Vul aub minimaal 1 materiaal in."></asp:Literal>
            <asp:Button ID="btnNewMaterial" runat="server" Text="Nieuw materiaal toevoegen" OnClick="btnNewMaterial_Click" CssClass="styledButton styledButton200" />
        </div>
        <div id="DivMaterialEdit" runat="server" class="materialEdit" visible="false">
            <div id="DivMaterialEditCheckBoxes" runat="server" class="materialEditCheckBoxes">
				<div id="DivUitvoerer" runat="server" class="boxRow">
					<asp:CheckBox ID="chkUitvoerder" runat="server" CssClass="checkBoxLabel" Text="Herstel door uitvoerder" />
				</div>
				<div id="DivHerstel" runat="server" class="boxRow">
					<asp:CheckBox ID="chkUitstel" runat="server" CssClass="checkBoxLabel" Text="Gedeeltelijk herstel" />
				</div>
            </div>
            <div id="DivMaterialEditBoxes" runat="server" class="materialEditBoxes">
                <div class="boxRow">
					<span class="rowBoxLabel">Materiaal</span>
					<asp:DropDownList ID="ddlMaterial" runat="server" CssClass="hiddenDropdown js_hiddenDropdown styledDropdown styledDropdown160">
					</asp:DropDownList>
					<div class="clear"></div>
                </div>
                <div class="boxRow">
					<span class="rowBoxLabel">Hoeveelheid</span>
					<telerik:RadNumericTextBox ID="txtQuantity" runat="server" CssClass="actualArea styledInput styledInput180" Width="162px"
						ShowSpinButtons="false" IncrementSettings-InterceptArrowKeys="true" IncrementSettings-InterceptMouseWheel="true"
						MinValue="1" NumberFormat-DecimalDigits="0" EnableEmbeddedBaseStylesheet="False" EnableEmbeddedSkins="False" Skin="workflow" />
					<div class="clear"></div>
	           </div>
            </div>
            <div class="clear"></div>
            <asp:Button ID="btnCancelNewMaterial" runat="server" Text="Annuleren" OnClick="btnCancelNewMaterial_Click" CssClass="styledButton styledButton150" />
            <asp:Button ID="btnSaveNewMaterial" runat="server" Text="Opslaan" OnClick="btnSaveNewMaterial_Click" CssClass="styledButton styledButton150" />
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
    
<script type="text/javascript">
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoaded);

    function pageLoaded(sender, args){
        workflow.form.checkboxCtrl.SetupLabel();
        workflow.form.select.Init(".js_hiddenDropdown:not(.init)");
    }
</script>